<?php
/**
 * @version		$Id: graphic.php 2011.08.11 thierry $
 * @package		admin.models.fields
 * @subpackage	com_projid
 * @copyright	Copyright (C) 2011 Pojid All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;
jimport('joomla.form.helper');

JFormHelper::loadFieldClass('list');


class JFormFieldGraphic extends JFormFieldList
{

	protected $type = 'Graphic';


protected function getOptions() 
	{
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('id_que, desc_que');
		$query->from('#__projid_requete');
		$db->setQuery((string)$query);
		$result = $db->loadObjectList();
		$options = array();
		if ($result){
			foreach($result as $entry) {
				$options[] = JHtml::_('select.option', $entry->id_que, $entry->desc_que);
			}
		}
		$options = array_merge(parent::getOptions(), $options);
		
	return $options;
	}
}
